package com.lx.javasunmmrize.proxy.staticProxy;

/**
 * @Description TeacherDao的代理类, 和TeacherDao实现相同的接口
 * @Author lx
 * @Date 2021/2/26 23:15
 **/
public class TeacherDaoProxy implements Teacher {

    //引用被代理类实例
    private TeacherDao teacherDao;


    public TeacherDaoProxy(TeacherDao teacherDao){
        this.teacherDao = teacherDao;
    }

    /**
     *
     */
    @Override
    public void teach() {
        System.out.println("被代理类方法执行前......可用于前置处理操作");
        teacherDao.teach();
        System.out.println("被代理类方法执行后......可用于后置操作");

    }
}
